package com.ranjiaqi.homework;

/**
 * @ClassName h_Runnable1
 * @Description TODO
 * @Author hp
 * @Date 2021/6/28 20:50
 * @Version 1.0
 **/
public class h_Runnable1 implements Runnable {

    private  int num ;

    public h_Runnable1(int num) {
        this.num = num;
    }

    @Override
    public void run() {
        if (num == 2){
            for (int i = 0; i < 50; i += num) {
                System.out.println(Thread.currentThread().getName()+"::i = " + i);
            }
        }
        if(num == 1){
            for (int i = 1; i  < 50; i += (num+1)) {
                System.out.println(Thread.currentThread().getName()+"::i = " + i);
            }
        }

    }
}
